<!DOCTYPE html>
<html>
	<head>
		<title>Simple IAM system!</title>
		<%= stylesheet_link_tag    "style", :media => "all" %>
		<%= stylesheet_link_tag    "bootstrap", :media => "all" %>
		<%= stylesheet_link_tag    "bootstrap-responsive", :media => "all" %>
		<%= javascript_include_tag "application" %>
		<%= csrf_meta_tags %>
	</head>
	<body>
		<div id="wrap">
			<div class="header">
				<div class="header1">
					<div class="navbar">
						<div class="navbar-inner">
							<p>
								<%= link_to "Simple AIM", :controller => 'default',:action => 'index' %>
							</p>
							<ul class="nav">
								<% if(controller.controller_name == "default")%>
								<li class="active">
									<%= link_to t('home'), :controller => '/default',:action => 'index' %>
								</li>
								<% else %>
								<li>
									<%= link_to t('home'), :controller => '/default',:action => 'index' %>
								</li>
								<% end %>		
		
							</ul>			
							
							
							<div class ="login">
								<%= image_tag("/assets/user_login_icon.png", :alt => "test image") %>
								<% if session[:user] %>
								<% current_user = session[:user]%>
								<div class="welcome">
									<%= t('Welcome')%> <%= current_user.fullname %> | 
									<% if(current_user.role == ADMIN_ROLE)%>
										<%= link_to t('Manager Page'),  manager_users_path %> | 
									<% end%>
									<%= link_to t('Change password'),  session_updatepassword_path %> |
									<%= link_to t('Sign out'), session_logout_path %>
								</div>
								<% else %>
								<%= form_tag session_auth_path do %>
								
								<div class="login-input">
									<%= text_field_tag :login_email,nil,:placeholder => 'email',:title => 'email'%>
								</div>
								
								<div class="login-input">
									<%= password_field_tag  :login_password,nil,:placeholder => 'password',:title => 'password'%>
								</div>
								
								<div class="btn-login">
									<%= submit_tag "Sign in", :class => 'btn'%>
								</div>
								<div class="signup">
									<%= link_to t('Forgot your password'),session_resetpassword_path %>
									<%= link_to t('Registration'),signup_path %>
								</div>
								<% end %>
								<% end %>
							</div>
						
						</div>
					</div>

				</div>
				<!-- end div header 1 -->
			</div>

			<div class = "main">
				<%= yield %>
			</div>
			
		</div>
	</body>
</html>